#region Usings

using System.Security.Principal;
using System.Web.Security;

#endregion

namespace Karma.Framework.Core.Security
{
    public class CustomIdentity : IIdentity
    {
        private FormsAuthenticationTicket _ticket;

        public CustomIdentity(FormsAuthenticationTicket ticket)
        {
            _ticket = ticket;
        }

        public FormsAuthenticationTicket Ticket
        {
            get { return _ticket; }
        }

        #region IIdentity Members

        public string Name
        {
            get { return _ticket.Name; }
        }

        public string AuthenticationType
        {
            get { return "Custom"; }
        }

        public bool IsAuthenticated
        {
            get { return true; }
        }

        #endregion
    }
}